use "Figure78_AppropsCounts.dta"
lpoly SeasonalDiff Cycle if Quarters==4, degree(3) generate(at smooth1) se(se) 
gen lb=smooth1-1.96*se
gen ub=smooth1+1.96*se
twoway (line se at)
keep at-ub
drop if at==.
save "Figure78_Q4dataset.dta"
clear

use "Figure78_AppropsCounts.dta"
lpoly SeasonalDiff Cycle if Quarters==3, degree(3) generate(at smooth1) se(se) 
gen lb=smooth1-1.96*se
gen ub=smooth1+1.96*se
twoway (line se at)
keep at-ub
drop if at==.
save "Figure78_Q3dataset.dta"
clear

use "Figure78_AppropsCounts.dta"
lpoly SeasonalDiff Cycle if Quarters==2, degree(3) generate(at smooth1) se(se) 
gen lb=smooth1-1.96*se
gen ub=smooth1+1.96*se
twoway (line se at)
keep at-ub
drop if at==.
save "Figure78_Q2dataset.dta"
clear

use "Figure78_AppropsCounts.dta"
lpoly SeasonalDiff Cycle if Quarters==1, degree(3) generate(at smooth1) se(se) 
gen lb=smooth1-1.96*se
gen ub=smooth1+1.96*se
twoway (line se at)
keep at-ub
drop if at==.
save "Figure78_Q1dataset.dta"
clear

use "Figure78_AppropsCounts.dta"
keep if Quarters==1
save "Figure7_AppropsCountsQ1.dta"

use "Figure78_AppropsCounts.dta"
keep if Quarters==2
save "Figure7_AppropsCountsQ2.dta"

use "Figure78_AppropsCounts.dta"
keep if Quarters==3
save "Figure7_AppropsCountsQ3.dta"

use "Figure78_AppropsCounts.dta"
keep if Quarters==4
save "Figure7_AppropsCountsQ4.dta"
